<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Lịch Sử Mua Hàng</title>
    </h:head>
    <h:body onload="true">
        <h:outputText value="${login.gettaikhoan().mataikhoan} đã mua các món hàng sau:"/>
        <table width="746" border="1" cellspacing="0" cellpadding="0">
           
                <c:if test="#{LichSuMuaHang.chitietddh.size()!=0}" >       
                    <c:set var="ds" value="#{LichSuMuaHang.chitietddh}"/> 
                    <c:forEach var="i" begin="1" end="${ds.size()}">
                        <tr>
                            <c:set var="ct" value="${ds.get(i-1)}"/>
                            <td>
                                
                                    <h:commandLink action="#{detailmobile.setThongtin1sanpham(ct.dienthoai.madienthoai)}">
                                        <h:graphicImage library="images" name="${ct.dienthoai.hinhanh.replace('ô', 'o')}" height="186" width="186"/>
                                    </h:commandLink>
                                    <br/>
                                    <h:outputText value="${ct.dienthoai.tendienthoai}" />
                                    <br/>
                                Giá: 
                                <h:outputText value="${ct.gia}">
                                    <f:convertNumber type="currency"  currencyCode="VND" groupingUsed="true"  maxFractionDigits="0"/> 
                                </h:outputText>

                            </td>
                           
                            <td>
                                Số Lượng:  <br/>
                                <h:outputText value="${ct.soluong}"/>
                            </td>

                            <td>
                                Ngày Mua Hàng:  <br/>
                                <h:outputText value="${ct.dondathang.ngaydathang}" />
                            </td>
                             <td>
                               Phương Thức Thanh Toán:  <br/>
                                <h:outputText value="${ct.dondathang.phuongthucthanhtoan}" />
                            </td>
                        </tr>
                    </c:forEach>
                </c:if>

                <c:if test="#{LichSuMuaHang.chitietddh.size()==0}" >     
                    <h:outputText value="bạn chưa mua hang." />
                </c:if>
          
        </table>
    </h:body>
</html>

